<template>
  <a @click="dialog = true">
    <span>编辑</span>
    <a-modal v-model="dialog" @ok="submit">
      <p>备注内容</p>
      <a-textarea class="text" :rows="4" v-model="content" />
    </a-modal>
  </a>
</template>
<script>
import { getaLoneRemarks, modifyRemarks } from '@/api/common'
export default {
  name: 'changeEdit',
  props: ['record'],
  data: () => ({
    dialog: false,
    content: ''
  }),
  mounted() {
    this.getData()
  },
  methods: {
    async submit() {
      var _form = {}
      _form.content = this.content
      await modifyRemarks(this.record.id, _form)
      this.dialog = false
      this.$emit('update')
    },
    async getData() {
      console.log('2222')

      var res = await getaLoneRemarks(this.record.id)
      this.content = res.result.data.content
    }
  }
}
</script>
<style lang="scss" scoped></style>
